<template>
    <div class="wrapper">
        <go-back bg="" color="black" title="讲师详情"></go-back>
        <div class="box">
            <teacher-concern v-for="(v,i) in listData" :key="i" :listData="v" @attenFun="attenFun"></teacher-concern>
        </div>
    </div>
</template>

<script>
import GoBack from '@/components/go-back.vue';
import teacherConcern from '@/components/teacter-concern.vue';
import { getAttensPort, getAttenPort } from '@/api/index'
export default {
    data() {
        return {
            page: 1,
            limit: 5,
            type: 2,
            listData: []
        };
    },
    created() {
        this.getAtten()
    },
    methods: {
        async getAtten() {
            let res = await getAttensPort(this.page, this.limit, this.type)
            console.log(res);
            this.listData = res.data.list
        },

        //关注/取消关注
        async attenFun(iid) {
            let res = await getAttenPort(iid)
            console.log(res);
            this.getAtten()
        },
    },
    components: {
        GoBack,
        teacherConcern

    },
};
</script>

<style lang="scss" scoped>
.wrapper {
    width: 100%;
    height: 100vh;
    background: #f4f4f4;
    .box{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}
</style>
